package cn.com.taiji.pos.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.github.dreamyoung.mprelation.EntityMapper;
import com.github.dreamyoung.mprelation.JoinColumn;
import com.github.dreamyoung.mprelation.ManyToOne;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author
 * @since 2021-03-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SystemRefundApproval implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "ID", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 主单ID
     */
    @TableField("MAIN_ID")
    private String mainId;
    @TableField(exist = false)
    @ManyToOne
    @EntityMapper
    @JoinColumn(name = "main_id", referencedColumnName = "id")
    private TradeConsumptionMain tradeConsumptionMain;

    /**
     * 退款金额
     */
    @TableField("REFUND_AMOUNT")
    private Double refundAmount;

    /**
     * 退款原因
     */
    @TableField("REFUND_REASONS")
    private String refundReasons;

    /**
     * 审批人ID
     */
    @TableField("APPROVAL_ID")
    private String approvalId;

    /**
     * 审批人姓名
     */
    @TableField("APPROVAL_NAME")
    private String approvalName;

    /**
     * 审批时间
     */
    @TableField("APPROVAL_TIME")
    private LocalDateTime approvalTime;

    /**
     * 审批状态
     */
    @TableField("APPROVAL_STATUS")
    private String approvalStatus;

    /**
     * 退款状态
     */
    @TableField("REFUND_STATUS")
    private String refundStatus;
    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;
    /**
     * 审批理由
     */
    @TableField(exist = false)
    private String reason;


    /**
     * 退款细单
     */
    @TableField(exist = false)
    private List<TradeConsumptionDetail> detailList;
    @TableField(exist = false)
    private List<String> detailListIds = new ArrayList<>();
    @TableField(exist = false)
    private String detailId;
    @TableField(exist = false)
    private String physicalCode;
    @TableField(exist = false)
    private String customerId;
    @TableField(exist = false)
    private String tkReason = "刷卡退款";


}
